//
//  CalculatorViewController.h
//  Calculator
//
//  Created by lding4 on 10/16/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

#define State_Init          0x01    // Init State with 0
#define State_Input         0x02    // User input state
#define State_Input_Dot     0x04    
#define State_Input_Ful     0x08
#define State_Output        0x10    // Just finish a calculation
#define State_Upper_Data    0x20    // There is number and operation symbol on the upper label
#define State_Error         0x40

#define Operation_Plus      0x01
#define Operation_Minus     0x02
#define Operation_Multiply  0x03
#define Operation_Devide    0x04

@interface CalculatorViewController : UIViewController {
    unsigned state;
    unsigned operation;
    double upperData;
    UILabel *upperLabel;
    UILabel *lowerLabel;
    BOOL NegativeSign;
}

@property (nonatomic, retain) IBOutlet UILabel *upperLabel;
@property (nonatomic, retain) IBOutlet UILabel *lowerLabel;

- (void)InitCalculator;
- (void)InitInput;
- (void)InitState;
- (void)AddState:(unsigned)NewState;
- (void)RemoveState:(unsigned)OldState;

- (IBAction)ButtonOnePressed:(UIButton *)button;

@end
